package com.qzsoft.zhjd.machine.modules.machinefuel.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @ClassName MachineRefuelRecordsEntity
 * @Description 加油记录
 * @author linhuawei
 * @since 2021-11-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@TableName("machine_refuel_records")
public class MachineRefuelRecordsEntity {


    /**
     * 主键
     */
    @NotBlank(message = "标识不可为空")
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;
    
    /**
     * 原始记录主键
     */
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String originalId;
    
    /**
     * 设备主键
     */
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String machineId;
    
    /**
     * 设备编号
     */
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String machineKey;
    
    /**
     * 加油量
     */
    private BigDecimal volume;
    
    /**
     * 设备采集值
     */
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private BigDecimal collectVolume;
    
    /**
     * 设备采集时间
     */
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private Date collectDate;
    
    /**
     * 人工校正值
     */
    @NotNull(message = "校正数值不可为空")
    @DecimalMin(value = "0", message = "校正值不可小于0")
    @DecimalMax(value = "1000", message = "校正值不可大于1000")
    private BigDecimal customVolume;

    /**
     * 人工校正日期
     */
    private Date customDate;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NEVER)
    private Date createDate;

}
